package SSF.App.DDoS;

import SSF.Net.Util.*;

class TraceInfo
{
    String hostNHI=null;
    int nicID=0;
    int destIP=0;
    long trafficSize;
    long numPackets;
    int numFlow=0;
    
    public TraceInfo(String hostNHI, int nicID, long trafficSize,
		     long numPackets)
    {
	this.hostNHI=hostNHI;
	this.nicID=nicID;
	this.trafficSize = trafficSize;
	this.numPackets = numPackets;
	numFlow = 1;
	destIP = 0;
    }

    public TraceInfo(int destIP, long trafficSize, long numPackets)
    {
	this.destIP = destIP;
	this.trafficSize = trafficSize;
	this.numPackets = numPackets;
	numFlow = 1;
    }

    public String toString() {
	return (hostNHI+"("+nicID+"): traffic "+
		trafficSize+", numPackets "+numPackets
		+", numFlow "+numFlow);
    }

    public String toString_2() {
	return ("IP:"+IP_s.IPtoString(destIP)+"-- traffic "+
		trafficSize+", numPackets "+numPackets
		+", numFlow "+numFlow);
    }

    void update(long newSize, long newNumPackets)
    {
	numFlow++;
	trafficSize += newSize;
	numPackets += newNumPackets;
    }
}
